home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11tl.lha / lbl / hips / sources / tools / magicprint.pro < prev    next >
Encoding:
Text File  |  1992-07-02  |  1.9 KB  |  56 lines

  1. %! Vertical & Horizontal
  2. %%magicprint halftone prolog -- illustrations & labels
  3. % UC - upper corner
  4. % if igp, RS=3.3, but 3.75
  5. % Jin Guojun    1/18/91
  6. /vshowdict 4 dict def
  7. /vshow {vshowdict begin /thestring exch def
  8.     /lineskip vt def
  9.     8 inch 10 inch moveto
  10.  thestring
  11.  {/charcode exch def
  12.  /thechar () dup 0 charcode put def
  13.  0 lineskip rmoveto
  14.  gsave
  15.     thechar stringwidth pop 2 div neg 0 rmoveto
  16.     thechar show
  17.  grestore
  18.  }forall
  19.  end}def
  20.  
  21. save 50 dict begin /magicprint exch def
  22. /inch {72 mul}def
  23. /chsign {-1. mul}def
  24. /setimstr {/cols exch def /imstr cols string def}def
  25. /placeim {sx sy translate}def
  26. /scaleim {iw 2 mul cvi ih 2 mul cvi scale}def
  27. /setcirc {/ang exch def /freq exch def freq ang
  28.     {dup mul exch dup mul add 1 exch sub}
  29.     setscreen}def
  30. /setline {/ang exch def /freq exch def freq ang
  31.     {pop abs 1 exch sub}
  32.     setscreen}def
  33. /setrc {/r exch def /c exch def}def
  34. /setnb {/nb exch def}def
  35. /setpos {/ih exch inch def /iw exch inch def
  36.     /sy exch inch def /sx exch inch iw sub def}def
  37. /setform {/FontW exch def /vt exch def /igp exch vt mul def
  38.     /LeftBd exch inch def /Margin exch inch def
  39.     /UC exch igp add def /Vpos UC def /RS 3.75 def}def
  40. /nl    {/Vpos {Vpos vt sub}def LeftBd Vpos moveto}def
  41. /newline {currentpoint pop LeftBd exch sub vt rmoveto} def
  42. /Box {Margin 0 rmoveto    currentpoint exch pop dup UC exch sub 0 exch rlineto
  43.     8.5 inch LeftBd 2 mul Margin 2 mul add sub 0 rlineto
  44.     0 exch UC sub rlineto closepath stroke} def
  45. /Hput {4.25 inch exch FontW mul sub igp add exch translate 0 0 moveto}def
  46. /Vput {inch exch FontW mul sub exch 4.5 add inch exch moveto 90 rotate}def
  47. /Rotate {/rangle exch def /sita exch def /radius exch inch def
  48.     /x sita sin radius mul def /y sita cos radius mul def
  49.     iw x sub sx add ih y sub sy add translate rangle rotate}def
  50. /imgo    {c r nb [c 0 0 r chsign 0 r]
  51.     {currentfile imstr readhexstring pop} image}def
  52. /imusd    {c r nb [c 0 0 r 0 0]
  53.     {currentfile imstr readhexstring pop} image}def
  54. /restorestate {clear magicprint end restore}def
  55. %end prolog -- begin data
  56.